package My_Workers;

import java.util.ArrayList;
import java.util.List;

public class ObservableMixin implements Observable
{
   List<Observer> observers = new ArrayList<Observer>();
   
   public void addObserver(Observer listener)
   {
      observers.add(listener);
   }

   public void removeObserver(Observer listener)
   {
      observers.remove(listener);
   }
   
   public void notifyObservers(Object event)
   {
      for (Observer observer : observers)
      {
         observer.update(event);
      }
   }
}
